package com.pxample.pemo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class RestControllerTest {

    @Autowired
    RestTemplate directRestTemplate;


    @PostMapping("/rest")
    public String getData(@RequestBody String body){
        return directRestTemplate.postForObject("http://localhost:8086/rest", null, String.class);
    }


    @GetMapping("/test")
    public String webclientTest(){
        return "hahhaahahahah";
    }


}
